<?php
/**
 * Created by PhpStorm.
 * User: Cloud
 * Date: 2018/4/2
 * Time: 10:10
 */
?>
<?php
if (isset($_SESSION['customer_info']['identity'])) {
    $sql = "select * from app_admin WHERE customer_id = " . $this->session->customer_id;
    $admin_info = $this->db->query($sql)->row_array();
}
?>
<div class="my-center-sidebar">
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo">
        <li class="layui-nav-item <?php if (in_array(uri_string(), array('member/personal', 'member/address', 'member/invoice', 'member/personal_password'))): ?>layui-nav-itemed<?php endif; ?>">
            <a href="javascript:;">基本信息</a>
            <dl class="layui-nav-child">
                <dd><a href="<?php echo base_url(); ?>member/personal">基本资料</a></dd>
                <dd><a href="<?php echo base_url(); ?>member/address">收货地址</a></dd>
                <dd><a href="<?php echo base_url(); ?>member/invoice">发票抬头</a></dd>
                <dd><a href="<?php echo base_url(); ?>member/personal_password">修改密码</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item">
            <a href="javascript:;">我的交易</a>
            <dl class="layui-nav-child">
                <dd><a href="<?php echo base_url(); ?>cart/index">我的购物车</a></dd>
                <dd><a href="<?php echo base_url(); ?>order/common_order">我的订单</a></dd>
            </dl>
        </li>
        <li class="layui-nav-item"><a href="<?php echo $this->config->item('shop_url'); ?>bBMember-myGoodsLibrary.html">我的商品库</a></li>
        <li class="layui-nav-item"><a href="<?php echo $this->config->item('shop_url'); ?>mMPur-indexnew.html">清单采购</a></li>
        <?php if (isset($_SESSION['customer_info']['identity'])): ?>
            <?php if ($_SESSION['customer_info']['identity'] == 1 && $admin_info['is_account'] == 1): ?>
                <li class="layui-nav-item <?php if (uri_string() == 'member/business_invoice'): ?>layui-nav-itemed<?php endif; ?>">
                    <a
                            style="border-bottom:0;" href="<?php echo base_url(); ?>member/business_invoice">企业发票</a>
                </li>
            <?php endif; ?>
        <?php endif; ?>
    </ul>
    <?php if (isset($_SESSION['customer_info']['identity'])): ?>
        <?php if ($_SESSION['customer_info']['identity'] == 1 && $admin_info['is_account'] == 1): ?>
            <?php if ($admin_info['account_period_type'] == 1): ?>
                <div class="selfhood"
                     <?php if (uri_string() == 'member/bill_month'): ?>style="background-color: #fff"<?php endif; ?>><a
                            href="<?php echo base_url('member/bill_month'); ?>">账期信息</a></div>
            <?php else: ?>
                <div class="selfhood"
                     <?php if (uri_string() == 'member/bill_time'): ?>style="background-color: #fff"<?php endif; ?>><a
                            href="<?php echo base_url('member/bill_time'); ?>">账期信息</a></div>
            <?php endif; ?>
        <?php endif; ?>
    <?php endif; ?>

    <?php if ($this->uri->segment(2) == 'bill_time' || $this->uri->segment(2) == 'bill_month'): ?>
        <!--        <div class="corporate-invoice-agreement">-->
        <!--            <p class="tit">合约客户企业采购协议</p>-->
        <!--            <a href="javascript:;" class="down-icon"></a>-->
        <!--            <div class="info">-->
        <!--                <p>协议编号：<br>wjyh201702280001</p>-->
        <!--                <p>有效期：<br>wjyh201702280001</p>-->
        <!--            </div>-->
        <!--        </div>-->
    <?php endif; ?>
</div>
